#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    string s;
    int a=0,b=0,c=0;
    getline(cin,s);
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='M'||s[i]=='m')a++;
        if(s[i]=='S'||s[i]=='s')b++;
        if(s[i]=='T'||s[i]=='t')c++;
    }
    cout<<a<<" "<<b<<" "<<c;
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}